@import './button.scss';
@import './wheel.scss';

.vxp-time-picker {
  @include basis;
  @include input-handler;

  $wheel: 'vxp-wheel';

  user-select: none;

  &__control {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
  }

  &__input {
    display: flex;
    align-items: center;
    outline: 0;
  }

  &__unit {
    padding: 0 2px;
    text-align: center;
    transition: $vxp-transition-background-base, $vxp-transition-color-base;

    &--focused {
      color: $vxp-color-content-reverse;
      background-color: $vxp-color-primary-light-1;
    }
  }

  &__label {
    text-align: center;
    user-select: none;
    transition: $vxp-transition-background-base, $vxp-transition-color-base;
  }

  &--disabled &__unit,
  &--disabled &__label {
    color: $vxp-color-content-secondary;
  }

  &__separator {
    color: $vxp-color-content-secondary;
  }

  &__exchange {
    display: flex;
    align-items: center;
    padding: 0 4px;
    padding-top: 1px;

    .vxp-icon {
      color: $vxp-color-content-secondary;
    }

    &--endabled:hover .vxp-icon {
      color: $vxp-color-primary;
    }
  }

  &__popper {
    z-index: $vxp-z-index-popper;
    display: flex;
    padding: 0.6em 0;
  }

  &__pane {
    display: flex;
    justify-content: center;
    min-width: 10.8em;
    background-color: $vxp-color-fill;
    border-radius: $vxp-border-radius-base;
    box-shadow: $vxp-box-shadow-base;
  }

  &__list {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;

    &--sub {
      align-items: flex-start;
      padding: 0.3em 0;
      background-color: $vxp-color-fill-background;
      border-right: $vxp-border-appearance $vxp-color-border-light-2;
    }
  }

  &__shortcut {
    max-width: 7em;
    padding: 0.4em 1.1em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: $vxp-transition-background-base;

    &:hover {
      background-color: $vxp-color-border-light-2;
    }
  }

  &__wheel {
    display: flex;
    padding: 0.4em 0.6em;
  }

  &--no-hour {
    .#{$wheel}:first-of-type {
      display: none;
    }
  }

  &--no-minute {
    .#{$wheel}:nth-of-type(2) {
      display: none;
    }
  }

  &--no-second {
    .#{$wheel}:last-of-type {
      display: none;
    }
  }

  &__action {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    padding: 0.4em 0.6em;
    border-top: $vxp-border-appearance $vxp-color-border-light-2;
  }
}
